_require "../../../../basis.smi"
_require "../../../../smlformat-lib.smi"
_require "../../../libs/toolchain/main/Filename.smi"
(*
_require local "./LOC.sig"
*)

structure Loc =
struct
  datatype file_place = STDPATH | USERPATH
  datatype source = FILE of file_place * Filename.filename | INTERACTIVE
  datatype pos = POS of {source : source, line : int, col : int,
                         pos : int, gap : int}
               | NOPOS
  type loc = pos * pos
  val compareLoc : loc * loc -> order
  val comparePos : pos * pos -> order
  val noloc : loc
  val nopos : pos
  val isNopos : pos -> bool
  val isNoloc : loc -> bool
  val mergeLocs : loc * loc -> loc
  val format_file_place
      : file_place -> SMLFormat.FormatExpression.expression list
  val format_source : source -> SMLFormat.FormatExpression.expression list
  val format_loc : pos * pos -> SMLFormat.FormatExpression.expression list
  val posToString : pos -> string
  val locToString : loc -> string
end
